<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>


<fmt:setBundle basename="ApplicationResources" />

<html>
<head>
    <title><fmt:message key="title.application"/></title>

    <link rel="STYLESHEET" type="text/css" href="<%= request.getContextPath() %>/css/style.css">
</head>
<%@ include file="/header.jsp" %>



<table border=0 width="100%">
 <tr>
    <td width="200" valign="top">
      <table class="framed" align="center" width="100%" cellspacing="2" cellpadding="2" border="0">
      
      <tr>
          <td>
           <a href="<%= request.getContextPath() %>/admin/view">
           <fmt:message key="menu.userManage"/></a>
          </td>
      </tr>
      <tr>
        <td>
         <a href="<%= request.getContextPath() %>/admin/displayDept">
            <fmt:message key="menu.deptManage"/></a>
        </td>
      </tr>
      <tr>
        <td>
            <a href="<%= request.getContextPath() %>/logout">Logout</a>
        </td>
      </tr>
     </table></td><td>
     
     <h2>Current User List</h2>
        
<table cellspacing="2" cellpadding="2" border="1" width="50%">

    <tr class="listHeading">
      <th><fmt:message key="fieldLabel.userId"/></th>
      <th><fmt:message key="fieldLabel.name"/></th>
      <th><fmt:message key="fieldLabel.employeeId"/></th>
      <th><fmt:message key="fieldLabel.roles"/></th>
    </tr>

 <c:forEach var="userList" items="${users}">
        <tr class="listRecord">
              <td>
                <c:url var="url" value="/admin/edit">
                 <c:param name="user_id" value="${userList.userId}" />
                </c:url>
                <a href="<c:out value="${url}"/>">
                  <c:out value="${userList.userId}"/>
                </a>
              </td>
              <td>
                <c:out value="${userList.name}"/>
              </td>
              <td>
                <c:out value="${userList.employeeId}"/>
              </td>
              <td>
              <c:forEach var="role" items="${userList.roles}">            
                  <c:out value="${role.name}"/> <br>
              </c:forEach>
              </td>
         </tr>
  </c:forEach>
</table>

</td></tr>
</table>


<%@ include file="/footer.jsp" %>